Image processing refers to any processing that is applied to an image. The processing can include application of various effects, masks, filters or the like, to the image. In this manner, the image can be enhanced in terms of contrast, converted to grey scale, or altered in some way. The image has typically been captured by a video camera, a still image camera or the like.
Weather conditions have a large impact on visibility, generally, but also for devices capturing images. Haze and fog especially give rise to unwanted stray light due to scattering. Imaging algorithms, referred herein to as “contrast enhancing processing”, have been developed that attempt to enhance contrast that may be lost due to the scattering caused by e.g. fog, haze and the like.
With reference to the contrast enhancing processing, some challenges arise when it is not known whether the scene to be captured includes fog or not. Should it be assumed that fog is present and contrast enhancing processing is applied all the time, this may cause severe quality degradation to images depicting scenes which do not include fog. The contrast enhancing processing is thus of limited use when it is not known whether the weather has caused fog in the image or not. Therefore, an operator of for example a video surveillance system manually turn on contrast enhancing processing when he/she observes fog in the images captured by the video surveillance system. Disadvantageously, there is thus a risk that the operator, or another operator on duty, forgets to turn off the contrast enhancing processing when not needed anymore, e.g. when the fog is gone, or almost gone.
A problem may therefore be related to how to automatically detect whether a scene imaged by a device includes fog or not.
According to known measures, a histogram of an image of the scene may be used in order to get a hint of whether or not fog is present in the scene. Briefly, the histogram is a plot illustrating number of pixels versus a range of available pixel values of the image. Hence, when the histogram is said to be flat, i.e. relatively many of the available pixel values are represented by a similar amount of pixels, it can be assumed that there is fog in the scene. However, scenes with flat dynamics without fog will also be represented by a similar histogram, which thus will cause the known measures to erroneously assume the scene to include fog. Any subsequently applied contrast enhancing processing would thus degrade quality of the image.
CN102539385 discloses a multi-wavelength fog haze identification method and a measurement method of the visibility. With the method, a color filter is installed in front of an optical receiver in a scattering visiometer. Further, a series of red, green and blue color filters are additionally installed through the optical receiver in the visiometer. In this manner, it may be discerned whether it is fog or haze. Moreover, a absorbance index may be calculated separately according to the difference between fog and haze.
US20090046894 discloses a process for the detection from a vehicle of a visibility interference phenomenon. A beam of light is emitted to illuminate the rear of the vehicle, the beam of light being emitted into a field of vision of a camera mounted in the vehicle. Next, a presence of and the nature of a visibility interference phenomenon is determined on the basis of at least one image captured by the camera.
In article “Image based fog detection in vehicles”, by PAVLIC M et al., laid open in INTELLIGENT VEHICLES SYMPOSIUM (IV), 2012 IEEE, IEEE, on 3 Jun. 2012, pages 1132-1137, XP032453047, DOI: 10.1109/1VS.2012.6232256, ISBN: 978-1-4673-2119-8, systems to detect fog in images based on contrast are disclosed. It is proposed to use image descriptors and a classification procedure in order to distinguish images with fog present from those free of fog. These image descriptors are global and describe the entire image using Gabor filters at different frequencies, scales and orientations.
In article “Contrast Restoration of Weather Degraded Images”, to NARASIMHAN S G et al., laid open in IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, IEEE COMPUTER SOCIETY, USA, vol. 25, no. 6, on 1 Jun. 2003, pages 713-724, XP001185045, ISSN: 0162-8828, DOI: 10.1109/TPAMI.2003.1201821, correlation between scattering values, presence of fog and different wavelengths, such as infrared, is explained. Images of outdoor scenes captured in bad weather suffer from poor contrast. Under bad weather conditions, the light reaching a camera is severely scattered by the atmosphere. The resulting decay in contrast varies across the scene and is exponential in the depths of scene points. There is proposed a physics-based model that describes the appearances of scenes in uniform bad weather conditions. Changes in intensities of scene points under different weather conditions provide simple constraints to detect depth discontinuities in the scene and also to compute scene structure.